<template>
  <HeaderList @open=" isShow = true "></HeaderList>
  <RouterView />

  <div class="about" :class="{ isshow: isShow == false }">
    <h1>关于</h1>
    <p>这个应用可以用来追踪你选的城市的当前天气</p>
    <h1>如何使用:</h1>
    <p>1,点击搜索框输入你希望追踪的城市</p>
    <p>2,在搜索结果中选中一个城市,你将获取当地最新的天气</p>
    <p>3,点击右侧的+号可以将追踪城市的天气情况保存在首页</p>
    <h1>移除城市</h1>
    <p>如果你不想再首页关注某个城市,可以通过底部的按钮删除它</p>
    <button @click=" isShow = false">关闭</button>
  </div>
  <div class="backcolor" :class="{ isshow: isShow == false }"></div>
</template>

<script setup>
import { ref } from 'vue';
import HeaderList from '@/components/HeaderList.vue';

const isShow = ref(false);
</script>

<style lang="scss" scoped>
.about {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 280px;
  background: #fff;
  padding: 16px;
  z-index: 10;
  transition: all 1s;
  h1 {
    font-size: 18px;
    font-weight: 400;
    margin-top: 10px;
    margin-bottom: 5px;
  }
  p {
    font-size: 12px;
    font-family: '微软雅黑';
    font-weight: 400;
    line-height: 14px;
  }
  button {
    margin-top: 10px;
    background: rgb(0, 102, 138);
    color: #fff;
    outline: none;
    border: none;
    width: 72px;
    height: 32px;
    cursor: pointer;
  }
  &.isshow {
    opacity: 0;
    
  }
}
.backcolor{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9;
    transition: all 0.2s;
    background: #333;
    opacity: 0.5;
    transition: all 1s;
     &.isshow{
        display: none;
    }
}
</style>
